package com.atguigu.config;

import com.atguigu.bean.Car;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author : wenchao.long
 * @date : Created in 2020/11/15 10:43:10 周日
 * @description : bean的生命周期
 */
@Configuration
@ComponentScan(basePackages = "com.atguigu.bean")
public class MainConfigOfLifeCycle {

    @Bean(initMethod = "init", destroyMethod = "destroy")
    public Car car() {
        return new Car();
    }
}
